package br.unicamp.ic.lis.dbvapi.domain;

import javax.persistence.Column;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

import com.vividsolutions.jts.geom.Geometry;

@Entity
@Table(name = "GeometryPV")
@DiscriminatorValue("GeometryPV")
public class GeometryPV extends AbstractPhysicalVersion<Geometry> {

	private static final long serialVersionUID = -1119502413075031026L;

	@Column(name = "spatialObject")
	@Type(type = "org.hibernatespatial.GeometryUserType")
	private Geometry spatialObject;

	public GeometryPV() {

	}

	public GeometryPV(Geometry spatialObject) {
		this.spatialObject = spatialObject;
	}

	@Override
	public Geometry getValue() {
		return spatialObject;
	}

	public Geometry getSpatialObject() {
		return spatialObject;
	}

	public void setSpatialObject(Geometry spatialObject) {
		this.spatialObject = spatialObject;
	}

	@Override
	public String toString() {
		return "GeometryPV [id=" + id + ", spatialObject=" + spatialObject
				+ "]";
	}

}
